﻿CREATE TABLE [dbo].[arhArticoleAliniate] (
    [ArtAl]              VARCHAR (40)  NOT NULL,
    [Denumire]           VARCHAR (200) NOT NULL,
    [AAParinte]          VARCHAR (40)  NOT NULL,
    [Terminal]           BIT           NOT NULL,
    [Titlu]              VARCHAR (100) NOT NULL,
    [Categorii]          VARCHAR (50)  NOT NULL,
    [TermDenumire]       VARCHAR (100) NOT NULL,
    [StartDenumire]      VARCHAR (100) NOT NULL,
    [Anexa6]             BIT           NOT NULL,
    [CodUnitate]         SMALLINT      DEFAULT ((0)) NOT NULL,
    [An]                 SMALLINT      DEFAULT ((0)) NOT NULL,
    [ExecutieCheltuieli] BIT           DEFAULT ((0)) NOT NULL,
    CONSTRAINT [PK_arhArticoleAliniate] PRIMARY KEY CLUSTERED ([ArtAl] ASC, [CodUnitate] ASC, [An] ASC),
    CONSTRAINT [FK_arhArticoleAliniate_arhArticoleAliniate] FOREIGN KEY ([AAParinte], [CodUnitate], [An]) REFERENCES [dbo].[arhArticoleAliniate] ([ArtAl], [CodUnitate], [An]),
    CONSTRAINT [FK_arhArticoleAliniate_Unitati] FOREIGN KEY ([CodUnitate]) REFERENCES [dbo].[Unitati] ([CodUnitate])
);

